package Test;

import java.util.ArrayList;

import org.junit.Test;

import DBLayer.DBTrainingDay;
import ModelLayer.TrainingDay;

public class TestDBTrainingDay
{
	DBTrainingDay dbtd = new DBTrainingDay();

	@Test
	public void testGetAllTrainingDay()
	{
		ArrayList<TrainingDay> tdlist = dbtd.findAllTrainingDay(false);
	    System.out.println("\nTrainingDay size : " + tdlist.size() + "\n");
	    int id = 0;
	    while(id < tdlist.size())
		{
	    	System.out.println("TrainingDayID        : " + tdlist.get(id).getTrainingDayID());
			System.out.println("PMDate               : " + tdlist.get(id).getDate());
			System.out.println("TrainingStart        : " + tdlist.get(id).getTrainingStart());
			System.out.println("TrainingEnd          : " + tdlist.get(id).getTrainingEnd());
			System.out.println("Intensity            : " + tdlist.get(id).getIntensity());
			System.out.println("Trainer ID           : " + tdlist.get(id).getTrainer().getTrainerID());
			System.out.println("Trainer FName        : " + tdlist.get(id).getTrainer().getfName());
			System.out.println("Trainer LName        : " + tdlist.get(id).getTrainer().getlName());
			System.out.println("Child ID             : " + tdlist.get(id).getChild().getChildID());
			System.out.println("Child CPR            : " + tdlist.get(id).getChild().getCPR());
			System.out.println("Child FName          : " + tdlist.get(id).getChild().getfName());
			System.out.println("Child LName          : " + tdlist.get(id).getChild().getlName());
			System.out.println("TrainingProgramID    : " + tdlist.get(id).getTrainingProgram().getTrainingProgramID());
			System.out.println("TrainingProgramName  : " + tdlist.get(id).getTrainingProgram().getName());
			System.out.println("----------------------------------------");
			id++;
		}
	}

	@Test
	public void testSearchTrainingDayID()
	{
		int id = 1;
		TrainingDay td = dbtd.searchTrainingDayID(id, false);
		System.out.println("TrainingDayID        : " + td.getTrainingDayID());
		System.out.println("PMDate               : " + td.getDate());
		System.out.println("TrainingStart        : " + td.getTrainingStart());
		System.out.println("TrainingEnd          : " + td.getTrainingEnd());
		System.out.println("Intensity            : " + td.getIntensity());
		System.out.println("Trainer ID           : " + td.getTrainer().getTrainerID());
		System.out.println("Trainer FName        : " + td.getTrainer().getfName());
		System.out.println("Trainer LName        : " + td.getTrainer().getlName());
		System.out.println("Child ID             : " + td.getChild().getChildID());
		System.out.println("Child CPR            : " + td.getChild().getCPR());
		System.out.println("Child FName          : " + td.getChild().getfName());
		System.out.println("Child LName          : " + td.getChild().getlName());
		System.out.println("TrainingProgramID    : " + td.getTrainingProgram().getTrainingProgramID());
		System.out.println("TrainingProgramName  : " + td.getTrainingProgram().getName());
		System.out.println("----------------------------------------");
	}
/*
	@Test
	public void testSearchTrainingCategoryName() {
		fail("Not yet implemented");
	}

	@Test
	public void testInsertTrainingCategory() {
		fail("Not yet implemented");
	}

	@Test
	public void testUpdateTrainingCategory() {
		fail("Not yet implemented");
	}

	@Test
	public void testDelete() {
		fail("Not yet implemented");
	}

	@Test
	public void testGetAllTrainingCategory() {
		fail("Not yet implemented");
	}

	@Test
	public void testSearchTrainingCategoryID(){
		fail("Not yet implemented");
	}
*/
}
